export function alipay(order) {
    order.that.$http.post('/alipay/create?orderNo=' + order.orderNo + '&orderName=' + order.orderName + '&payPrice=' + order.payPrice).then((response) => {
        if(order.loading != null){
            order.loading.close();
        }
        const div = document.createElement('div');
        div.innerHTML = response.data;
        document.body.appendChild(div);
        document.forms[document.forms.length - 1].submit();
    }).catch((err) => { loading.close(); this.$msg.error(err) })
}

export function paypal(order) {
    order.that.$http.post("/paypal/toPay?orderId=" + order.orderNo + "&orderName=" + order.orderName + "&payPrice=" + order.payPrice)
        .then(response => {
            if(order.loading != null){
                order.loading.close();
            }
            window.location.href = response.data
        })
        .catch((err) => {
            loading.close();
            this.$msg.error(err);
        });
}

